<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>
<script>
	$(document).ready(function() {
		//聚焦第一个输入框
		$("input").get(0).focus();
	});
</script>
<form id="inputForm" class="well form-inline" action="${ctx}/adoms/brand/saveAgent" method="post">
	<table class="table table-striped table-bordered table-condensed">
		<thead>
			<i class="icon-flag"></i>
			<strong>品牌代理商设定</strong>
		</thead>
		<tr>
			<td class="span2">品牌名称:</td>
			<td>
				<c:if test="${brand != null }">
					<input value="${brand.id }" type="hidden" name="id" />${brand.name }
				</c:if>
				<c:if test="${brandList != null }">
					<select id="id" name="id">
						<c:forEach items="${brandList }" var="brand">
							<option value="${brand.id }">${brand.name }</option>
						</c:forEach>
					</select>
				</c:if>
			</td>
		</tr>
		<tr>
			<td>代理商(门店):</td>
			<td>
				<c:forEach items="${departmentList }" var="department">
					<label class="checkbox">
						<input name="department.id" value="${department.id }" type="checkbox"
							<c:forEach items="${brand.department }" var="d">
								<c:if test="${d.id == department.id }">checked</c:if>
							</c:forEach> />
						${department.name }
					</label>
				</c:forEach>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input class="btn" type="submit" value="提交" />
				&nbsp;
				<input class="btn" type="button" value="返回" back="back" />
			</td>
		</tr>
	</table>
</form>
